package haders

import (
	"log/slog"
	"net/http"

	"github.com/alexedwards/scs/v2"
)

func NewRouter(pool Dao, sesion *scs.SessionManager, logger *slog.Logger) http.Handler {
	mux := http.NewServeMux()
	mux.HandleFunc("GET /", home(sesion, logger, pool))
	mux.HandleFunc("GET /auth/login/google", googleHandler(logger))

	mux.HandleFunc("GET /auth/callback", googleCallbackHandler(logger, pool, sesion))
	mux.HandleFunc("GET /dashboard", dashboard(sesion, logger))
	mux.HandleFunc("POST /auth/reg", reg(sesion, logger, pool))
	return mux
}
